home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
ARGONET
/
PD
/
FILER
/
FSCKFRIEND.ZIP
/
!fsckFrend
/
!RunImage
(
.txt
)
< prev
next >
Wrap
RISC OS BBC BASIC V Source
|
1995-09-17
|
9KB
|
377 lines
>!RunImage
block% 1024
nagg(
$+" at line "+
taskname$="fsckFrend"
dirname$="<fsckfrend$dir>"
iconname$=""
menuname$="fsck"
taskwinnum%=0
Ainitialslot%=
OS_ReadVarVal("fsckfrend$slotsize")):
kBytes
9startupcomm$="fsck "+
OS_ReadVarVal("fsckfrend$disc")
*disc$=
OS_ReadVarVal("fsckfrend$disc")
Gaqdelay%=100*
OS_ReadVarVal("fsckfrend$AUTOQUITDELAY")):
seconds
,aquit%=
this will be munged later :-)
screwed%=
Bbdel%=
OS_ReadVarVal("fsckfrend$beeptimer")):
centi-seconds
7beep%=
OS_ReadVarVal("fsckfrend$audiosignal")="Yes"
icn%=0
#child_task_handle%=-1:paused%=
running%=
disc$="edit me!"
0,"You haven't read the !Help file, have you?":
taskid% 8:$taskid%="TASK"
"Wimp_Initialise",200,!taskid%,taskname$
version%,taskhandle%
nagg(
$+" at line "+
men% 256,indic% 24,wblk% 512
"Hourglass_On"
sprites:
templates:
initmenus
pii(main%,1,"fsck-ing")
pii(main%,2,disc$)
changeval(main%,0,"s!fsckfrend")
createtaskwindow
running%=
*seteval fsck$returncode -1
openwindow(main%)
"Hourglass_Off"
(aquit%
screwed%)
*C
"OS_ReadMonotonicTime"
now%:
aquit%=0 quitat%=now%+200
"Wimp_PollIdle",-
(aquit%
screwed%),block%,quitat%
reason%
"OS_ReadMonotonicTime"
now%
now%>=quitat%
screwed%
beep%
icn%=0
2'
changeval(main%,0,"serror2")
icn%=2
4
5&
changeval(main%,0,"serror")
icn%=0
7
8'
"OS_ReadMonotonicTime"
now%
quitat%=now%+bdel%
reason%
0 :
aquit%
>.
"OS_ReadMonotonicTime"
now%
?&
now%>=quitat%
2 :
"Wimp_OpenWindow",,block%
3 :
"Wimp_CloseWindow",,block%:
!block%=main%
9 :
menuclick(block%)
6 :
block%!8=2
popupmenu(
17,18:
nagg(nagg$)
"Wimp_ReportError"," "+nagg$,1<<4,taskname$
nagg("Error in death throes!"):
"Wimp_CloseDown",taskhandle%,!taskid%
click_type
c%=block%!8
c%=2
popupmenu(
block%!16
&808C1:
message_Output
&808C2:
message_Ego
&808C3:
message_Morio
initmenus
b" i%=
initmenu(men%,menuname$)
c' i%=
additem(i%,"Info",0,inf_win%)
d" i%=
additem(i%,"Pause",0,-1)
e" i%=
additem(i%,"Quit",-1,-1)
popupmenu(bar%)
"Wimp_GetPointerInfo",,block%
j2q=!block%:w=block%!4:w%=block%!12:i%=block%!16
k w+=24
menu%=men%
"Wimp_CreateMenu",,menu%,q-64,w
n&lastmenu%=menu%:menx%=q-64:meny%=w
templates
infb% 512,infi% 200,mainb% 256,maini% 64
"Wimp_OpenTemplate",,dirname$+".templates"
t:inf_win%=
template("info",infb%,infi%,200,-1,sprites%)
u8main%=
template("main",mainb%,maini%,64,-1,sprites%)
"Wimp_CloseTemplate"
template(name$,buf%,ind%,len%,fonts%,sprs%)
"Wimp_LoadTemplate",,buf%,ind%,ind%+len%,fonts%,name$,0
buf%!64=sprs%
"Wimp_CreateWindow",,buf%
handle%
=handle%
sprites
(file%=
(dirname$+".Sprites"+
suffix)
file%=0
nagg("Can't find spritefile!"):
#file%)+128
#file%
sprites% S%
sprites%!0=S%
sprites%!8=16
"OS_SpriteOp",9+256,sprites%
"OS_SpriteOp",10+256,sprites%,dirname$+".SPRITEs"+
suffix
menuselection(blk%,menu%)
"Wimp_DecodeMenu",,menu%,blk%,wblk%+64
=$(wblk%+64)
menuclick(brtnd%)
, item$=
menuselection(brtnd%,lastmenu%)
item$
"Quit" :
"Pause" :
pause
OS_ReadVarVal(A$)
"OS_ReadVarVal",A$,block%,256,0,3
,,L :A$=""
a= 0
A$=A$+
(block%!a)
child_task_handle%<>-1
killtaskwindow
initmenu(menu%,menuname$)
2$menu%=menuname$: :
menu title
Emenu%?12=7:menu%?13=2 :
title foreground & background
Emenu%?14=7:menu%?15=0 :
menu foreground & background
(menuname$)>5
" menu%!16=(
(menuname$)+1)*16
menu%!16=6*16
2menu%!20=44 :
width & height of items
@menu%!24=0 :
vertical gap twixt items
=menu%+28
additem(menu%,text$,last%,sub%)
last%
!menu%=128
!menu%=0
menu%!4=sub%
menu%!8=&7000021
$(menu%+12)=text$
=menu%+24
tick(menu%,text$,grey%)
menu%+=4
menu%+=24
# flags%=menu%!8:last%=!menu%
mt$=$(menu%+12)
mt$=text$
last%=128
mt$<>text$
nagg("Error - can't (un)tick '"+text$+"' in menu cuz it doesn't exist!"):
grey%
!menu%=last%
1<<0
!menu%=last%
(1<<0)
createtaskwindow
taskwinnum%+=1
/ cli$="*TASKWINDOW "+
34+startupcomm$+
9 cli$+=" -wimpslot "+
(initialslot%)+"K -name "+
cli$+=" (fsck)"+
6 cli$+=" -ctrl -quit -task &"+
hex8(taskhandle%)
! cli$+=" -txt &"+
hex8(666)
"Wimp_StartTask",cli$
tick(men%,"Pause",
hex8(n%)
"00000000"+
~n%,8)
message_Ego
newhandle%=block%!4
# child_task_handle%=newhandle%
message_Morio
child_task_handle%=-1
checkresults
killtaskwindow
child_task_handle%=-1
O !block%=20:block%!4=0:block%!8=0:block%!12=0:block%!16=&808C4:
die scum!
"Wimp_SendMessage",17,block%,child_task_handle%
pausewindow
child_task_handle%=-1
2 !block%=20:block%!4=0:block%!8=0:block%!12=0
I block%!16=&808C6:
Freeze Motherfucka, or I'll blow your balls off!
"Wimp_SendMessage",17,block%,child_task_handle%
resumewindow
child_task_handle%=-1
2 !block%=20:block%!4=0:block%!8=0:block%!12=0
< block%!16=&808C7:
Nice'n'slow, hands on the fender...
"Wimp_SendMessage",17,block%,child_task_handle%
message_Output
pause
paused%
resumewindow
tick(men%,"Pause",
paused%=
pausewindow
tick(men%,"Pause",
paused%=
openwindow(window%)
!wblk%=window%
"Wimp_GetWindowState",,wblk%
wblk%!28=-1
flags%=wblk%!32
(flags%
1<<16)=0
!wblk%=window%
"Wimp_GetWindowInfo",,wblk%
/ mwid%=
read_mode(-1,11)<<
read_mode(-1,4)
/ mhig%=
read_mode(-1,12)<<
read_mode(-1,5)
! width%=(wblk%!12)-(wblk%!4)
" height%=(wblk%!16)-(wblk%!8)
* wblk%!4=0:
mwid% DIV2 - width% DIV2
wblk%!12=(wblk%!4)+width%
wblk%!8=mhig%-height%
wblk%!16=wblk%!8+height%
wblk%!28=-1
"Wimp_OpenWindow",,wblk%
read_mode(mode%,var%)
"OS_ReadModeVariable",mode%,var%
,,value%
=value%
changeval(window%,icon%,to$)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
$(wblk%!32)=to$
wblk%!8=0
wblk%!12=0
"Wimp_SetIconState",,wblk%
grey(menu%,text$,grey%)
menu%+=4
menu%+=24
%# flags%=menu%!8:last%=!menu%
mt$=$(menu%+12)
mt$=text$
last%=128
mt$<>text$
nagg("Error - can't (un)grey '"+text$+"' in menu cuz it doesn't exist!"):
grey%
menu%!8=flags%
1<<22
menu%!8=flags%
(1<<22)
checkresults
--return$=
OS_ReadVarVal("fsck$returncode")
tick(men%,"Pause",
grey(men%,"Pause",
return$="0"
changeval(main%,0,"Sphew"):
updatewindow(main%)
running%=
"OS_ReadMonotonicTime"
quitat%
quitat%+=aqdelay%
aqdelay%<0
aquit%=
aquit%=
changeval(main%,0,"Serror"):
updatewindow(main%)
aquit%=
bdel%>=0
screwed%=
;*
"OS_ReadMonotonicTime"
quitat%
quitat%+=bdel%
pii(main%,1,
why(return$))
pii(window%,icon%,text$)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
F%ot$=$(wblk%!28):$(wblk%!28)=text$
wblk%!8=0
wblk%!12=0
ot$<>text$
"Wimp_SetIconState",,wblk%
changeval(window%,icon%,to$)
!wblk%=window%
wblk%!4=icon%
"Wimp_GetIconState",,wblk%
$(wblk%!32)=to$
wblk%!8=0
wblk%!12=0
"Wimp_SetIconState",,wblk%
why(code$)
(code$)
32,33,48,49 : ="Need Hardfix"
1024 : ="FS error"
1,16,17: ="Fixable"
4,16,20 : ="Unfixable :-("
0 : ="Map Good"
-1 : ="fsck died"
&1000 : ="increase memory"
&800 : ="I/O error"
512 : ="Bad parameters"
256 : ="Useless fsck"
:="Unk="+code$
suffix
g1xeig%=
read_mode(-1,4):yeig%=
read_mode(-1,5)
yeig%>xeig%
="24"
i ="22"
updatewindow(window%)
"Wimp_ForceRedraw",window%,0,-1E9,1E9,0